# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.ValueTransformation do
  @moduledoc """
  Description of data transformation during migration as part of the ConditionalColumnSetValue.

  ## Attributes

  *   `applyHash` (*type:* `GoogleApi.DataMigration.V1.Model.ApplyHash.t`, *default:* `nil`) - Optional. Applies a hash function on the data
  *   `assignMaxValue` (*type:* `GoogleApi.DataMigration.V1.Model.Empty.t`, *default:* `nil`) - Optional. Set to max_value - if integer or numeric, will use int.maxvalue, etc
  *   `assignMinValue` (*type:* `GoogleApi.DataMigration.V1.Model.Empty.t`, *default:* `nil`) - Optional. Set to min_value - if integer or numeric, will use int.minvalue, etc
  *   `assignNull` (*type:* `GoogleApi.DataMigration.V1.Model.Empty.t`, *default:* `nil`) - Optional. Set to null
  *   `assignSpecificValue` (*type:* `GoogleApi.DataMigration.V1.Model.AssignSpecificValue.t`, *default:* `nil`) - Optional. Set to a specific value (value is converted to fit the target data type)
  *   `doubleComparison` (*type:* `GoogleApi.DataMigration.V1.Model.DoubleComparisonFilter.t`, *default:* `nil`) - Optional. Filter on relation between source value and compare value of type double.
  *   `intComparison` (*type:* `GoogleApi.DataMigration.V1.Model.IntComparisonFilter.t`, *default:* `nil`) - Optional. Filter on relation between source value and compare value of type integer.
  *   `isNull` (*type:* `GoogleApi.DataMigration.V1.Model.Empty.t`, *default:* `nil`) - Optional. Value is null
  *   `roundScale` (*type:* `GoogleApi.DataMigration.V1.Model.RoundToScale.t`, *default:* `nil`) - Optional. Allows the data to change scale
  *   `valueList` (*type:* `GoogleApi.DataMigration.V1.Model.ValueListFilter.t`, *default:* `nil`) - Optional. Value is found in the specified list.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :applyHash => GoogleApi.DataMigration.V1.Model.ApplyHash.t() | nil,
          :assignMaxValue => GoogleApi.DataMigration.V1.Model.Empty.t() | nil,
          :assignMinValue => GoogleApi.DataMigration.V1.Model.Empty.t() | nil,
          :assignNull => GoogleApi.DataMigration.V1.Model.Empty.t() | nil,
          :assignSpecificValue => GoogleApi.DataMigration.V1.Model.AssignSpecificValue.t() | nil,
          :doubleComparison => GoogleApi.DataMigration.V1.Model.DoubleComparisonFilter.t() | nil,
          :intComparison => GoogleApi.DataMigration.V1.Model.IntComparisonFilter.t() | nil,
          :isNull => GoogleApi.DataMigration.V1.Model.Empty.t() | nil,
          :roundScale => GoogleApi.DataMigration.V1.Model.RoundToScale.t() | nil,
          :valueList => GoogleApi.DataMigration.V1.Model.ValueListFilter.t() | nil
        }

  field(:applyHash, as: GoogleApi.DataMigration.V1.Model.ApplyHash)
  field(:assignMaxValue, as: GoogleApi.DataMigration.V1.Model.Empty)
  field(:assignMinValue, as: GoogleApi.DataMigration.V1.Model.Empty)
  field(:assignNull, as: GoogleApi.DataMigration.V1.Model.Empty)
  field(:assignSpecificValue, as: GoogleApi.DataMigration.V1.Model.AssignSpecificValue)
  field(:doubleComparison, as: GoogleApi.DataMigration.V1.Model.DoubleComparisonFilter)
  field(:intComparison, as: GoogleApi.DataMigration.V1.Model.IntComparisonFilter)
  field(:isNull, as: GoogleApi.DataMigration.V1.Model.Empty)
  field(:roundScale, as: GoogleApi.DataMigration.V1.Model.RoundToScale)
  field(:valueList, as: GoogleApi.DataMigration.V1.Model.ValueListFilter)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.ValueTransformation do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.ValueTransformation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.ValueTransformation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
